{% import "TopxiaWebBundle::macro.html.twig" as web_macro %}
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class=""> <!--<![endif]-->
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>{% block title %} {{ setting('site.name', 'EDUSOHO') }} - {% if setting('site.slogan') %}{{ setting('site.slogan') }} -{% endif %} Powered by EDUSOHO{% endblock %}</title>
      <meta name="keywords" content="{% block keywords %}{% endblock %}" />
      <meta name="description" content="{% block description %}{% endblock %}" />
      <meta content="{{ csrf_token('site') }}" name="csrf-token" />
      {{ setting('login_bind.verify_code', '')|raw }}
      {% if setting('site.favicon') %}
      <link href="{{ asset(setting('site.favicon')) }}" rel="shortcut icon" />
      {% endif %}
      {% block stylesheets %}
        <link href="{{ asset('assets/libs/gallery2/bootstrap/3.1.1/css/bootstrap.css') }}" rel="stylesheet" />
        <link rel="stylesheet" media="screen" href="{{ asset('assets/css/common.css') }}" />
        <link rel="stylesheet" media="screen" href="{{ asset('assets/css/bootstrap-extends.css') }}" />
        <link rel="stylesheet" media="screen" href="{{ asset('bundles/topxiaweb/css/web.css') }}" />
        <link rel="stylesheet" media="screen" href="{{ asset('themes/graceful/css/graceful.css') }}d" />
        {{ render(controller('GracefulThemeBundle:GracefulThemeWeb:getCurrentConfigColor', {isIndex:isIndex|default(null)})) }}
        <link rel="stylesheet" media="screen" href="{{ asset('bundles/topxiaweb/css/member.css') }}" />
        <!--[if lt IE 8]>
          <link href="{{ asset('assets/css/oldie.css') }}" rel="stylesheet">
        <![endif]-->
      {% endblock %}
      <!--[if lt IE 9]>
        <script src="{{ asset('assets/libs/html5shiv.js') }}"></script>
      <![endif]-->

      <!--[if IE 8]>
        <script src="{{ asset('assets/libs/respond.min.js') }}"></script>
      <![endif]-->

  {% block head_scripts %}{% endblock %}

</head>
<body {% if bodyClass|default('') %}class="{{ bodyClass }}"{% endif %}>

{% block body %}
<div id="wrapper">
      
      <!-- header -->
      <div class="navbar site-navbar one-nav" id="site-navbar"  data-counter-url="{{ path('user_remind_counter') }}">
              <div class="container">
              <div class="container-gap">
                    <div class="navbar-header clearfix">
                    
                          <!-- btn-->
                          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                                  <span class="iconfont  icon-nanrentouxiang"></span>
                          </button>
                      
                          <!-- btn-->
                          <div class="menu-btn">
                                  <span class="iconfont icon-menu"></span>
                          </div>

                          <!-- logo -->
                          {% if setting('site.logo') %}
                            <a class="navbar-brand-logo" href="{{ path('homepage') }}"><img src="{{ asset(setting('site.logo')) }}"></a>
                          {% else %}
                            <a class="navbar-brand-logo" href="{{ path('homepage') }}">{{ setting('site.name', 'EDUSOHO') }}</a>
                          {% endif %}

                          {# search form #}
                          <form class="navbar-form navbar-left clearfix" role="search" action="/search">
                              <div class="form-group">
                                <input type="search" class="form-control" placeholder="" name="q">
                              </div>
                              <button type="submit" class="btn"><span class="iconfont  icon-sousuo1"></span></button>
                          </form>

                    </div>

                    <div class="navbar-collapse collapse">
                           <ul class="nav navbar-nav navbar-right">
                                  {% if app.user %}
                                  <li class="dropdown">

                                      <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                     <img class="img-circle" src="{{ file_path(app.user.smallAvatar, 'avatar.png') }}">

                                 <p>我</p></a>

                                        <ul class="dropdown-menu">
                                              <li><a href="{{ path('user_show', {id:app.user.id}) }}"><i class="glyphicon glyphicon-home"></i> 我的主页</a></li>
                                              <li><a href="{{ path('settings') }}"><i class="glyphicon glyphicon-cog"></i> 帐号设置</a></li>
                                              {% if is_granted('ROLE_ADMIN') %}
                                              <li><a href="{{ path('admin') }}"><i class="glyphicon glyphicon-lock"></i> 管理后台</a></li>
                                              {% endif %}
                                              <li><a href="{{ path('logout') }}"><i class="glyphicon glyphicon-off"></i> 退出</a></li>
                                        </ul>
                                  </li>

                                  <li><a href="{{ path('my') }}"> <span class="iconfont icon-iconbook"></span><p>课程</p></a></li>

                                 <li>
                                  <a href="{{ path('message') }}" class="badge-container message-badge-container">
                                    <span class="iconfont  icon-email"></span>
                                    <p>消息</p>
                                    {% if app.user.newMessageNum > 0 %}<i class="badge">{{ app.user.newMessageNum }}</i>{% endif %}
                                  </a>
                                  </li>

                                  <li>
                                        <a href="{{ path('notification') }}" class="badge-container notification-badge-container">
                                        <span class="iconfont icon-wushenglaba"></span>
                                       <p>通知</p>
                                        {% if app.user.newNotificationNum > 0 %}<i class="badge">{{ app.user.newNotificationNum }}</i>{% endif %}</a>
                                  </li>

                                 {% else %}
                                  <li><a href="{{ path('login') }}"> <span class="iconfont icon-login"></span><p>登录</p></a></li>
                                  <li><a href="{{ path('register') }}"> <span class="iconfont icon-zhuce"></span><p>注册</p></a></li>
                                {% endif %}
                        </ul>
                    </div><!--/.navbar-collapse end -->
             </div>
             <div class="menu-sec">
             {{ render(controller('TopxiaWebBundle:Default:topNavigation', {siteNav:siteNav|default(null)})) }}
             </div>
    </div>{# container #}     

  </div>{#   header end #}

  <!-- content -->
  <div id="main" class="container">
       {% if app.user and app.user.setup == 0 and (hideSetupHint is not defined or hideSetupHint != true) %}
          <div class="alert alert-warning">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            为了帐号的安全，以及更好的使用体验，请设置您的Email地址。
            <a href="{{ path('settings_setup') }}">现在就去设置</a>
          </div>
        {% endif %}

      {% block content %}{% endblock %}
         
  </div>


  {# footer-fir #}
  {{ render(controller('GracefulThemeBundle:GracefulThemeWeb:getCurrentConfigBottom', {isIndex:isIndex|default(null)})) }}
  
{% endblock %}
</div>

<div id="login-modal" class="modal" data-url="{{ path('login_ajax') }}"></div>
<div id="modal" class="modal"></div>

{% include 'TopxiaWebBundle::script_boot.html.twig' with {script_main: asset('bundles/topxiaweb/js/app.js')} %}

<div class="fixed-bar">
  {% if setting('mobile.enabled', false) %}
    <a href="{{ path('mobile') }}"><span class="iconfont icon-mobile"></span></a>
  {% endif %}
  <a class="go-top"><span class="iconfont icon-top"></span></a>
</div>

</body>
</html>